package com.beijiteshop.shop.ui.order.repo

import com.beijiteshop.libcommon.network.ext.BaseRsp
import com.beijiteshop.libcommon.network.ext.ResultRsp
import com.beijiteshop.shop.model.api.request.AddCartOrderRequest
import com.beijiteshop.shop.model.api.request.CartOrderInfoRequest
import com.beijiteshop.shop.model.api.request.OrderRequest
import com.beijiteshop.shop.model.api.request.RefundRequest
import com.beijiteshop.shop.model.api.response.*
import retrofit2.Call
import retrofit2.http.Body
import retrofit2.http.GET
import retrofit2.http.POST
import retrofit2.http.Query

/**
 * @Author LiaoZhongKai
 * @Date 2021/3/8 17:59
 * @Description 订单确认页面接口
 */
interface OrderService {

    @GET("/api/goods/getorderinfo")
    fun getOrderInfo(@Query("goodId") goodId: String): Call<BaseRsp<OrderConfirmBean>>

    /**
     * 单独下单购买商品
     */
    @POST("/api/order/addorder")
    fun commitOrder(@Body order: OrderRequest): Call<BaseRsp<String>>

    @GET("/api/order/getorderlist")
    fun getOrderList(@Query("page") page: Int,@Query("status") status: Int?): Call<BaseRsp<List<OrderListBean>?>>

    @GET("/api/order/detail")
    fun getOrderDetailInfo(@Query("id") id: String): Call<BaseRsp<OrderDetailBean>>

    @GET("/api/order/getorderinfo")
    fun getOrderPayInfo(@Query("ordernumber") orderNumber: String): Call<BaseRsp<OrderPayBean>>

    @POST("/api/refund/refundadd")
    fun requestRefund(@Body request: RefundRequest): Call<ResultRsp>

    @POST("/api/order/getcartgoodschecked")
    fun getShopCartOrderInfo(@Body request: CartOrderInfoRequest): Call<BaseRsp<CartOrderConfirmBean>>

    /**
     * 购物车添加订单
     */
    @POST("/api/order/addcartorder")
    fun addCartOrder(@Body request: AddCartOrderRequest): Call<BaseRsp<String>>
}